<template>
  <view class="value-added-detail-page">
    <image class="page-bg" src="/static/images/bg.png" mode="aspectFill" />
    <view class="gradient-bg" :style="{ top: navBarHeight + 'px' }"></view>
    <CustomNavbar title="增值业务扣费记录" />
    
    <view class="page-content" :style="{ paddingTop: navBarHeight + 'px' }">
      <view class="user-info-section">
        <view class="user-phone">
          <text class="phone-number">{{ phoneNumber }}</text>
          <view class="date-picker" @click="showDatePicker">
            <image class="calendar-icon" src="/static/icons/icon-data.png" mode="aspectFit" />
            <text class="date-text">{{ currentDate }}</text>
          </view>
        </view>
      </view>
      
      <!-- 摘要卡片 -->
      <view class="summary-cards">
        <image class="bg-image" src="/static/images/bg3.png" mode="aspectFill" />
        <view class="summary-cards-wrapper">
          <view class="summary-card">
            <text class="card-title">记录条数(条)</text>
            <text class="card-value">{{ totalCount }}</text>
          </view>
          <view class="summary-card">
            <text class="card-title">费用合计(元)</text>
            <text class="card-value">{{ totalCost }}</text>
          </view>
        </view>
      </view>
      
      <!-- 详单明细 -->
      <view class="detail-section">
        <view class="section-header">
          <view class="section-line"></view>
          <text class="section-title">详单明细</text>
        </view>
        <view class="empty-state">
          <view class="empty-box">
            <image src="/static/icons/icon-none.png" alt=""/>
            <text class="empty-text">暂无内容哦~</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import CustomNavbar from '@/components/CustomNavbar.vue'

const navBarHeight = ref(88)
const phoneNumber = ref('189*****0691')
const currentDate = ref('2025年10月')
const currentMonth = ref(0)
const monthTabs = ref(['10月', '9月', '8月', '7月', '6月', '5月', '4月'])
const totalCount = ref('0')
const totalCost = ref('0.00')

onLoad((options) => {
  if (options && options.phoneNumber) {
    phoneNumber.value = options.phoneNumber
  }
})

onMounted(() => {
  const windowInfo = uni.getWindowInfo()
  const statusBarHeight = windowInfo.statusBarHeight || 0
  navBarHeight.value = statusBarHeight + 44
})

const showDatePicker = () => {
  uni.showToast({
    title: '日期选择功能',
    icon: 'none'
  })
}
</script>

<style scoped>
.value-added-detail-page {
   
  position: relative;
  z-index: 1;
}

.page-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  object-fit: cover;
}

.gradient-bg {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.page-content {
  position: relative;
  z-index: 2;
  padding: 40rpx;
  padding-bottom: 40rpx;
}

.user-info-section {
  margin-top: 40rpx;
}

.user-phone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40rpx;
}

.phone-number {
  color: rgba(255, 255, 255, 1);
  font-family: HarmonyOS Sans SC;
  font-size: 32rpx;
  font-weight: 700;
  line-height: 38rpx;
}

.date-picker {
  display: flex;
  align-items: center;
  border-radius: 40px;
  backdrop-filter: blur(8px);
  background: linear-gradient(180.00deg, rgba(255, 255, 255, 0.9),rgba(222.26136779785156, 233.55055236816406, 255, 0.9) 20%,rgba(197, 217, 255, 0.9) 53%,rgba(227.102294921875, 236.72218322753906, 255, 0.9) 90%,rgba(255, 255, 255, 0.9) 100%);
  gap: 8rpx;
  padding: 8rpx 16rpx;
}

.calendar-icon {
  width: 32rpx;
  height: 32rpx;
}

.date-text {
  color: rgba(78, 138, 254, 1);
  font-family: HarmonyOS Sans SC;
  font-size: 28rpx;
  font-weight: 500;
  line-height: 32rpx;
}

.month-tabs {
  display: flex;
  justify-content: space-around;
  text-align: center;
  align-items: center;
  margin-bottom: 30rpx;
  overflow-x: auto;
}

.tab-item {
  padding: 8rpx 16rpx;
  color: rgba(255, 255, 255, 0.8);
  font-family: HarmonyOS Sans SC;
  font-size: 32rpx;
  font-weight: 400;
  line-height: 38rpx;
  border-radius: 8rpx;
  white-space: nowrap;
}

.tab-item.active {
  border-radius: 20px;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 1);
  color: rgba(78, 138, 254, 1);
}

.summary-cards {
  display: flex;
  align-items: center;
  flex-direction: column;
  z-index: 2;
  margin-bottom: 32rpx;
}

.bg-image {
  width: 670rpx;
  height: 158rpx;
}

.summary-cards-wrapper {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-card {
  border-radius: 16rpx;
  padding: 32rpx 100rpx;
  flex-direction: column;
  display: flex;
  align-items: center;
}

.card-title {
  color: rgba(255, 255, 255, 1);
  font-family: HarmonyOS Sans SC;
  font-size: 28rpx;
  font-weight: 400;
  line-height: 32rpx;
  margin-bottom: 16rpx;
}

.card-value {
  color: rgba(255, 255, 255, 1);
  font-family: HarmonyOS Sans SC;
  font-size: 48rpx;
  font-weight: 700;
  line-height: 56rpx;
}

.detail-section {
  margin-bottom: 40rpx;
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 24rpx;
}

.section-line {
  width: 8rpx;
  height: 40rpx;
  background: rgba(78, 138, 254, 1);
  border-radius: 4rpx;
  margin-right: 16rpx;
}

.section-title {
  color: rgba(51, 51, 51, 1);
  font-family: HarmonyOS Sans SC;
  font-size: 32rpx;
  font-weight: 700;
  line-height: 38rpx;
}

.empty-state {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80rpx 0;
}

.empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24rpx;
  padding: 60rpx 40rpx;
  border-radius: 16rpx;
  min-width: 400rpx;
}
.empty-box image{
  width: 280rpx;
  height: 280rpx;
}
.empty-text {
  color: rgba(153, 153, 153, 1);
  font-family: HarmonyOS Sans SC;
  font-size: 28rpx;
  font-weight: 400;
  line-height: 32rpx;
}
</style>

